'use strict';

angular.module('afasApp')
.filter('takeTime', ['$filter', function ($filter) {
    return function (collection, data) {
      var results = [];

      angular.forEach(collection, function(value, key){
        angular.forEach(data, function(valueData, keyData){
          value[valueData.ExpectedProp] = $filter('date')(value[valueData.OriginalProp], 'HH:mm');
        });
        results.push(value);
      });

      return results;
    };
  }]);